with open(r"C:\\Users\\wbw\\Desktop\\Whhpython\\20200318practice\\student.txt", "w+") as w:
    while True:
        sorted_lines = sorted(open('C:\\Users\\wbw\\Desktop\\Whhpython\\20200318practice\\student.txt'), key=lambda s:s.split()[2],reverse=1)
        w.write("".join(sorted_lines))
        break
    print(w.readlines())
w.close
